from tkinter import Tk
from tkinter import Menu
import tkinter as tk

from database.employ_function_admin.addemploy import AddEmploy
from database.employ_function_admin.admendemploy import AdmendEmploy
from database.employ_function_admin.searchemploy import SearchEmploy
from database.employ_function_admin.deleteemploy import DeleteEmploy


def EmployPage(): #员工信息
    admin_employ_screen = Tk()
    admin_employ_screen.title('员工信息管理')
    screen_width, screen_height = admin_employ_screen.maxsize()
    # 窗口的宽和高
    width = 410
    height = 140
    centre = '%dx%d+%d+%d' % (width, height, (screen_width - width) / 2,
                              (screen_height - height) / 2)
    admin_employ_screen.geometry(centre)
    welcome = tk.Label(admin_employ_screen, text='请选择功能！', font=('楷体', 20))
    welcome.place(x=120, y=40)
    def add():
        AddEmploy()
    def amend():
        AdmendEmploy()
    def search():
        SearchEmploy()
    def delete():
        DeleteEmploy()
    def returnn():
        admin_employ_screen.destroy()

    menu_employ = Menu(admin_employ_screen)
    menu_employ.add_command(label='添加', command=add)
    menu_employ.add_command(label='修改', command=amend)
    menu_employ.add_command(label='查询', command=search)
    menu_employ.add_command(label='删除', command=delete)
    menu_employ.add_command(label='返回', command=returnn)

    admin_employ_screen.config(menu=menu_employ)

    admin_employ_screen.mainloop()

if __name__=='__main__':
    EmployPage()
